import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;

public class Main {
    public static void main(String[] args) {
        byte[] array1 = new byte[100];
        byte[] array2 = new byte[100];
        try {
            FileInputStream f1 = new FileInputStream("C:\\Copy\\1.txt");
            FileOutputStream f2 = new FileOutputStream("C:\\Copy\\2.txt");


            //从input.txt读取所有数据
            f1.read(array1);
            System.out.println(array1);
            f2.write(array2);
            System.out.println(array2);

            //将所有数据写入newFile
            f2.write(array1);
            System.out.println("将Copy.1文件复制到Vc.1");

            // 关闭流
            f1.close();
            f2.close();
        } catch (Exception e) {
            e.getStackTrace();
        }
    }
    static void str(){
            byte[] array1 = new byte[100];
             byte[] array2 = new byte[100];

            try {
                FileInputStream f1 = new FileInputStream("C:\\Vc\\1.txt");
                FileOutputStream f2 = new FileOutputStream("C:\\Vc\\2.txt");
                f1.read(array1);
                f2.write(array2);
                System.out.println("将Copy.2文件复制到Vc.2.txt");

                // 关闭流
                f1.close();
                f2.close();
            }
            catch (Exception e) {
                e.getStackTrace();
            }

        }


            }


